package org.zb.resource;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.util.Log;
import org.zb.object.Enemy;
import org.zb.object.PhysicalObject;
import org.zb.object.Player;

public class ImagesManager {

	public static ImagesManager instance = new ImagesManager();
	
	SpriteSheet enemySheet;
	SpriteSheet playerSheet;
	
	public ImagesManager() {
		try {
			Image enemyImage = new Image("data/zombie1.png");
			enemySheet = new SpriteSheet(enemyImage, 50, 100);
			
			Image playerImage = new Image("data/player1.png");
			playerSheet = new SpriteSheet(playerImage, 75, 100);
			
		} catch (SlickException e) {
			Log.error(e);
		}
	}	
	
	public SpriteSheet getSpriteSheet(PhysicalObject object) {
		if(object instanceof Player)
			return playerSheet;
		else 
			return enemySheet;
	}
	
}
